<!--
  @author heguanghua
  @since 2019/06/12 19:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'sort', width:80, unresize:true, sort:true, align:'center', edit:'text'}">排序</th>
        <th lay-data="{field:'standardId', width:80, unresize:true, align:'center'}">ID</th>
        <th lay-data="{field:'title', unresize:false, align:'left',minWidth:220}">标题</th>
        <th lay-data="{field:'version', unresize:true, align:'center',width:100}">版本号</th>
        <th lay-data="{field:'category', width:180, unresize:true, align:'center'}">类别</th>
        <th lay-data="{field:'creater', width:110, unresize:true, align:'center'}">作者</th>
        <th lay-data="{field:'dept', width:230, unresize:true, align:'center'}">发布部门</th>
        <th lay-data="{field:'status', width:110, unresize:true, align:'center'}">发布状态</th>
        <th lay-data="{field:'mustRead', width:110, unresize:true, align:'center'}">是否必须阅读</th>
        <th lay-data="{field:'createTime', width:170, unresize:true, align:'center'}">创建时间</th>
        <th lay-data="{field:'操作', width:170, unresize:true, align:'center', fixed:'right'}">操作</th>
    </tr>
    </thead>

    <tbody>
    <tr th:each="item:${items}">
        <td></td>
        <td th:text="${item.sort}">sort</td>
        <td th:text="${item.standardId}" class="">standardId</td>
        <td th:text="${item.title}" class="layui-gray">title</td>
        <td th:text="${item.version}" class="layui-gray">version</td>
        <td th:text="${T(com.zmn.plat.common.dictionary.StandardCategoryEnum).of(item.category).name}" class="">category</td>
        <td th:text="${item.creater}" class="">creater</td>
        <td th:text="${item.deptTwoName == null || item.deptTwoName == '' ? item.deptOneName: item.deptOneName + '/' + item.deptTwoName}" class="">dept</td>
        <td>
            <input th:disabled="${(#authPermit.checkPermit('/standard/record/updateStatus.action'))?'false':'true'}" type="checkbox" name="status" id="status" th:key="${item.standardId}" th:value="${item.status}"
                   lay-text="ON|OFF" lay-skin="switch" lay-filter="chk_one_status" th:checked="${item.status == 2}"/>
        </td>
        <td th:text="${item.mustRead == 1 ? '否': '是'}" class="">mustRead</td>
        <td th:text="${(item.createTime==null?'':#dates.format(item.createTime, 'yyyy/MM/dd HH:mm:ss'))}">createTime</td>
        <td>
            <a style="color: #00a0e9" lay-text="查看" th:lay-href="|/standard/record/preview.action?standardId=${item.standardId}|">查看</a>&nbsp;&nbsp;
            <a th:if="${#authPermit.checkPermit('/standard/record/detail.action')}" style="color: #00a0e9" lay-text="修改" th:lay-href="|/standard/record/detail.action?standardId=${item.standardId}|">修改</a>&nbsp;&nbsp;
            <a th:if="${#authPermit.checkPermit('/standard/record/downLoadFiles.action')}" style="color: #00a0e9" th:onclick="downLoadFiles([[${item.standardId}]])">下载附件</a>
        </td>
    </tr>
    </tbody>
</table>
